<template>
  <div>
    <el-dialog title="提示" :visible.sync="dialogVisible" width="900px" :before-close="handleClose">
      <el-row>
        <el-col :span="6">
          <div>【题型】:{{this.ListEvery.questionType|questionTypes}}</div>
        </el-col>
        <el-col :span="6">
          <div>【编号】:{{ListEvery.id}}</div>
        </el-col>
        <el-col :span="6">
          <div>【难度】:{{}}</div>
        </el-col>
        <el-col :span="6">
          <div>【标签】：{{this.ListEvery.tags}}</div>
        </el-col>
        <el-col :span="6">
          <div>【学科】:{{this.ListEvery.subjectName}}</div>
        </el-col>
        <el-col :span="6">
          <div>【目录】:{{this.ListEvery.catalog}}</div>
        </el-col>
        <el-col :span="6">
          <div>【方向】</div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { detail } from '../../api/hmmm/questions'
import { questionType } from '../../api/hmmm/constants'
export default {
  name: 'questions-preview',
  props: {
    data: {
      type: Object,
      default: () => {}
    }
  },
  data () {
    return {
      dialogVisible: false,
      ListEvery: {}
    }
  },
  filters: {
    // 题型
    questionTypes (value) {
      if (value) return questionType.find(item => item.value === +value).label + '题'
    }
  },
  created () {

  },
  mounted () {

  },
  methods: {
    async  open () {
      this.dialogVisible = true
      const data = await detail({ id: this.data.id })
      // console.log('xxx')
      console.log('111xxx')
      // console.log(this.data)
      // console.log(data)
      // console.log(data)
      this.ListEvery = data.data
      // console.log('hhh')
      // console.log(this.ListEvery)
      // console.log(this.data.id)
    },

    handleClose (done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done()
        })
        .catch(_ => {})
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
